<?php

use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        
        //测试数据插入  遍历214条数据
       	$tmp = [];
       	for($i = 0; $i < 214; $i++)
       	{
       		$user['user_name'] = str_random(10);
       		$user['password'] = Crypt::encrypt('123');
       		$user['status'] = 0;
       		$user['email'] = str_random(5)."@sina.com";
       		$user['pic'] = 'default.jpg';
       		$time = time();
       		$user['created_at'] = $time; //创建时间
       		$user['updated_at'] = $time; //更新时间
       		$tmp[] = $user;
       	}
       	DB::table('users') -> insert($tmp);//链接数据库 执行insert  插入数据库
        
    }
}
